<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Collect extends Model
{
protected $guarded=[];
//根据商品id,获取商品信息
public function getGood($good){
     return   $goods=Goods::where('id',$good)->first();
}
//收藏与商品关联
public function getGoods(){
    return $this->belongsTo(Goods::class,'goods_id','id');
}
}
